home *** CD-ROM | disk | FTP | other *** search
/ SGI O2 Out of Box Experience / SGI O2 Out of Box Experience.iso / cgi-bin / nph-startRegistration.cgi < prev    next >
Text File  |  1996-11-14  |  5KB  |  136 lines

  1. #!/bin/sh
  2.  
  3. #**************************************************************************
  4. #*                                                                        *
  5. #*            Copyright (c) 1993 Silicon Graphics, Inc.                   *
  6. #*                      All Rights Reserved                               *
  7. #*                                                                        *
  8. #*         THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI             *
  9. #*                                                                        *
  10. #* The copyright notice above does not evidence any actual of intended    *
  11. #* publication of such source code, and is an unpublished work by Silicon *
  12. #* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
  13. #* the property of Silicon Graphics, Inc. Any use, duplication or         *
  14. #* disclosure not specifically authorized by Silicon Graphics is strictly *
  15. #* prohibited.                                                            *
  16. #*                                                                        *
  17. #* RESTRICTED RIGHTS LEGEND:                                              *
  18. #*                                                                        *
  19. #* Use, duplication or disclosure by the Government is subject to         *
  20. #* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in   *
  21. #* Technical Data and Computer Software clause at DFARS 52.227-7013,      *
  22. #* and/or in similar or successor clauses in the FAR, DOD or NASA FAR     *
  23. #* Supplement. Unpublished - rights reserved under the Copyright Laws of  *
  24. #* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N.       *
  25. #* Shoreline Blvd., Mountain View, CA 94039-7311                          *
  26. #**************************************************************************
  27.  
  28.  
  29. DISPLAY=:0.0
  30. export DISPLAY
  31.  
  32. # First thing, check to see if we've already started Cust Reg
  33. #   If so, exit.  If not, continue on.......
  34.  
  35. # Note that this is very specific, so if the calling string changes,
  36. #       we must change this conditional as well.
  37.  
  38. found=`/sbin/ps -ef | grep "Register_&_Win" | grep -v grep`
  39. if [ -n "$found"  ]; then
  40.         /usr/bin/X11/xconfirm -c -B "OK" -icon progress \
  41.             -font '-*-helvetica-medium-r-narrow--19-*-*-*-p-83-iso8859-1' \
  42.             -t "Customer Registration has already been started..."  > /dev/null
  43.         exit
  44. fi
  45.  
  46.  
  47.  
  48. server_protocol=$SERVER_PROTOCOL;
  49. server_software=$SERVER_SOFTWARE;
  50.  
  51. /sbin/echo "$server_protocol 200 OK"
  52. /sbin/echo "Server: $server_software"
  53. /sbin/echo "Content-Type: text/html\n\n";
  54.  
  55.  
  56.  
  57. # Print header
  58. /sbin/echo "<html>\n";
  59. /sbin/echo "<body bgcolor=#000000 text=#996688>\n";
  60. /sbin/echo "<PRE>\n";
  61. /sbin/echo "</PRE>\n";
  62. /sbin/echo "<h2>    Starting EndUser Registration...</h2>\n";
  63. /sbin/echo "<P>\n";
  64. /sbin/echo "             <FONT SIZE="3">It may take up to 30 seconds to start this tool.</FONT>\n";
  65. /sbin/echo "<BR>\n";
  66. /sbin/echo "             <FONT SIZE="3">Please be patient.</FONT>\n";
  67. /sbin/echo "</P>\n";
  68. /sbin/echo "</body>\n";
  69. /sbin/echo "</html>\n";
  70.  
  71.  
  72. #  Because we are starting from CGI, we need to reset the
  73. #    $HOME so that Netscape can find the preferences file and
  74. #    cache directory.
  75. HOME=/tmp/.custreg; export HOME
  76. TMPDIR=/tmp; export TMPDIR
  77.  
  78. if [ ! -d $HOME ]; then
  79.     /sbin/mkdir $HOME
  80. fi
  81.  
  82. if [ ! -d $HOME/.netscape ]; then
  83.     /sbin/mkdir $HOME/.netscape
  84. fi
  85.  
  86. if [ ! -d $HOME/.netscape/cache ]; then
  87.     /sbin/mkdir $HOME/.netscape/cache
  88. fi
  89.  
  90. # Get OutOfBox's copy of the preferences file for us to use
  91. /bin/cp /CDROM/misc/cgiPreferences $HOME/.netscape/preferences
  92. /sbin/chown nobody.nobody $HOME/.netscape/preferences
  93.  
  94. # Get OutOfBox's plugin.list file - this cuts significant time off of startup
  95. #     Use OutOfBox's list becuase it will be current - it was just created...
  96. /bin/cp /usr/people/OutOfBox/.netscape/plugin-list $HOME/.netscape/plugin-list
  97. /sbin/chown nobody.nobody $HOME/.netscape/plugin-list
  98.  
  99. # Get the Xdefaults file so that the File->Exit menu is available
  100. /bin/cp /CDROM/misc/cgiXdefaults $HOME/.Xdefaults
  101. /sbin/chown nobody.nobody $HOME/.Xdefaults
  102.  
  103.  
  104.  
  105. # Before the user starts System Setup, get rid of the lock file so
  106. #    that we don't get an error next time we start.  (Netscape only
  107. #    removes the lock when you quit via File->Exit.)
  108. #    The lock is actually a link, so we check for "-l"
  109. if [ -l $HOME/.netscape/lock ]; then    
  110.     /sbin/rm $HOME/.netscape/lock
  111. fi
  112.  
  113.  
  114. # Check to be sure that we have the correct Netscape version number
  115. #   in our preferences file; we don't want the customers to see
  116. #   the license agreement window...
  117. /usr/people/OutOfBox/bin/netscapeVsn.pl nobody $HOME
  118.  
  119.  
  120. # run app in background
  121. `/var/www/htdocs/WhatsNew/CustReg/Register_\&_Win -oobe`;
  122.  
  123.  
  124. # turn the secondary area black again.
  125. /sbin/echo "<html>\n";
  126. /sbin/echo "<body onLoad='self.location=\"file:/CDROM/entryspace/off.html\"'>\n";
  127. /sbin/echo "</body>\n";
  128. /sbin/echo "</html>\n";
  129.  
  130.  
  131.  
  132. # After the user quits Cust Reg, get rid of the temporary home directory
  133. if [  -d $HOME ]; then
  134.     /bin/rm -rf $HOME
  135. fi
  136.